package com.itlong.cloud.commons.dao;

import com.itlong.cloud.POJO.PO.AmountChangeInfoPO;
import com.itlong.cloud.POJO.PO.AppUserAccountBalancePO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectAmountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * <desc>
 *     更新金额数据库访问接口
 * </desc>
 *
 * @createDate 2018/9/24
 */

@Mapper
@Repository
public interface IUpdateAmountDao {


    /**
     * <desc>
     *      根据项目编号查询项目相关金额
     * <desc/>
     * @param  projectId   项目编号
     * @return 余额
     * @author Qiang.S
     * @createDate 2018/9/23
     */
    PropertyProjectAmountVO getProjectAmountInfo(String projectId);

    /**
     * <desc>
     *     更新项目金额信息
     * </desc>
     *
     * @param  projectId   项目编号
     * @param allowedCashWithdrawl 可提现余额
     * @param accountAmount 实时账户余额
     * @return 执行行数
     * @author Qiang.S
     * @createDate 2018/9/23
     */
    Integer updateProjectAmount(@Param("projectId") String projectId, @Param("allowedCashWithdrawl") String allowedCashWithdrawl,
                                @Param("accountAmount") String accountAmount);

    /**
     * <desc>
     *      根据项目编号查询最后一条
     * <desc/>
     * @param  projectId   项目编号
     * @return
     * @author Qiang.S
     * @createDate 2018/9/23
     */
    AmountChangeInfoPO getLastAmountChangeInfo(String projectId);

    /**
     * <desc>
     *      查询微信最后一条
     * <desc/>
     *
     * @return
     * @author Qiang.S
     * @createDate 2018/9/23
     */
    AmountChangeInfoPO getLastAmountWechatInfo();

    /**
     * <desc>
     *      新增
     * <desc/>
     *
     * @param  params   通用信息
     * @return
     * @author Qiang.S
     * @createDate 2018/9/26
     */
    Integer save(Map<String, Object> params);

}
